#! /bin/sh

export MAVEN_OPTS=-XX:MaxPermSize=512M

#mvn_settings=/ws_support/maven/settings_crh.xml
#prj_dir_base=/workspaces/eclipse/bc_hscs20/Sources

prj_path=$1
if [ -n "$prj_path" ];then
    prj_path="$prj_path/"
fi

mvn_cmdline="mvn clean install"
if [ -n "$mvn_settings" ];then
    echo mvn_settings: "$mvn_settings"
    mvn_cmdline="$mvn_cmdline -s $mvn_settings"
fi

pom_file=$prj_path"pom.xml"
if [ -n "$prj_dir_base" ];then
    pom_file="$prj_dir_base/$pom_file"
fi

if [ ! -e "$pom_file" ];then
    echo "==============================="
    echo "$prj not exists, will use the one in the repository"
    echo "==============================="
    continue
fi

$mvn_cmdline -f "$pom_file" $1
if [ $? -ne 0 ];then
exit 1
fi


